RemoveFrameSheetFrames
RemoveFrameSheetFrames FrameSheet, StartFrame, EndFrame
 
Parameters:

    FrameSheet = The Frame Sheet you wish to delete frames from
    StartFrame = The Start of the run of frames to remove
    EndFrame = The End of the run of frames to remove
Returns: NONE
 

     The RemoveFrameSheetFrames command removes a series of frames from a frame sheet. This can be very useful when loading frame sheet images that have more than one animation sections on them. So we can use RemoveFrameSheetFrames to remove any excess frames.




FACTS:


      * None

 
Example Source: Download This Example
; include the frame sheet animation library
  #Include "FrameSheetAnims"
  
; Clear the Screen so we can see the display frames better
  Cls 255
  
; The FIlename of the frame sheet to load
  File$=ProgramDir$()+"Help/Commands/Media/Animations/explosions.png"
  
; Load the Frame sheet
  FrameSheet=LoadFrameSheet(File$,64,64,RGB(0,0,0))
  
  
  
; Draw the frames from the frame sheet to the screen.
  Gosub DrawFrameSheet
  
  
; Remove the last 10 frames from the sheet
  LastFRame=GetframeSheetCount(FrameSheet)
  StartFrame =LastFrame-10
  RemoveFrameSheetFrames(FrameSheet,StartFrame,LastFrame)
  
  
  
; Re Draw the frames from the frame sheet to the screen.
  Gosub DrawFrameSheet
  
  
  
  
; show the screen to the user and wait for a key press
  Sync
  WaitKey
  
  End
  
  
  
DrawFrameSheet:
  
  
  Print "Frames in Frame Sheet"
  
; Display the number of frames in this sheet
  Print "Frames In Sheet:"+Str$(GetFrameSheetCount(FrameSheet))
  
; Get the current print cursor position
  Ypos=GetCursorY()     +10
  Xpos=0
; run through this frame sheet and draw each frame to the screen
  For lp=0 To GetFrameSheetCount(FrameSheet)-1
     ThisIMage=GetFrameSheetImage(FrameSheet,lp)
     DrawImage ThisImage,Xpos,Ypos,false
     Width=GetImageWidth(thisImage)+2
     Xpos+=Width
     If (Xpos+Width)=>GetScreenWidth()
        Xpos=0
        Ypos+=GetImageHeight(thisImage)+2
     EndIf
  Next
  SetCursorY Ypos+100
  
  Return
  
  
  
  
 
Related Info: LoadFrameSheet | NewFrameSheet :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com